home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_nub_croc.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  170 lines

  1. # Jones 3D Cog Script
  2. #
  3. # nub_Croc.cog
  4. #
  5. # [TL] [GGJ]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. #
  9. # ========================================================================================
  10. symbols
  11.  
  12. message        startup
  13. message        activated
  14. message        arrived
  15. message        entered
  16. message        exited
  17.  
  18. thing        croc
  19. thing        gate
  20. thing        player                            local
  21. thing        actor
  22. thing        lever
  23. thing        crocCam
  24. thing        crocTarg
  25.  
  26. surface        leverFace
  27.  
  28. keyframe    in_pull=in_pull_lever.key        local
  29. keyframe    lever_down=gen_lever_pull.key    local
  30.  
  31. material    animmat0=nub_acr_pulley.mat        local
  32. material    animmat1=rigear.mat                local
  33. material    animmat2=gen_a4chain.mat        local
  34.  
  35. sound        leverSound0=nub_lever_pull_c.wav    local
  36. sound        noSound=inxj088.wav                    local        # Nope.
  37.  
  38. flex        fps=5.9                            local
  39.  
  40. int            tracknum0                        local
  41. int            tracknum1                        local
  42. int            tracknum2                        local
  43. int            done=0                            local
  44. int            position=0                        local
  45. int            curcam                            local
  46. int            speaking=0                        local
  47.  
  48. end
  49.  
  50. # ========================================================================================
  51. code
  52.  
  53. startup:
  54.  
  55. player = GetLocalPlayerThing();
  56.  
  57. return;
  58.  
  59. # ........................................................................................
  60. activated:
  61.  
  62. # player activated with an IMP part so bail out
  63. if((GetCurWeapon(player) >= 14) && (GetCurWeapon(player) <= 18)) return;
  64.  
  65. if (done == 1)
  66. {
  67.     if (speaking == 1) return;
  68.     speaking=1;
  69.     PlayVoice(player, nosound, 1, 1);
  70.     speaking=0;
  71.     return;
  72. }
  73.  
  74.  
  75. if ((GetSenderRef() == lever) && (position == 1))
  76. {
  77.     StartCutscene(1);
  78.     done = 1;
  79.     
  80.     # player activated with lighter
  81.     if(GetCurWeapon(player) == 13)
  82.     {
  83.         # put away the lighter
  84.         DeselectWeapon(player);
  85.         DeselectWeaponWait(player);
  86.     }
  87.     
  88.     # Remember the current camera
  89.     curCam = GetCurrentCamera();
  90.  
  91.     # Prep player
  92.     SetActorFlags(player, 0x200000);
  93.     StopThing(player);
  94.     PlayMode(player, 1, 0);
  95.     
  96.     # Cut to cutscene camera
  97.     SetCameraFocus(2, crocCam);
  98.     SetCameraSecondaryFocus(2, crocTarg);
  99.     SetCurrentCamera(2);
  100.     SetCameraFOV(90, 0, 0.0);
  101.     
  102.     CopyPlayerHolsters(player, actor);
  103.     SetThingFlags(player, 0x80000);
  104.     ClearThingFlags(actor, 0x80000);
  105.     
  106.     # Play the animations - wait for Indy's
  107.     PlayKey(lever, lever_down, 4, 0x14, 0);
  108.     PlayKey(actor, in_pull, 4, 0x12, 0);
  109.     Sleep(1.2);
  110.     PlaySoundThing(leversound0, lever, 1.0, -1.0, -1.0, 0x0);
  111.     Sleep(1.4);
  112.     #PlaySoundThing(leversound1, lever, 1.0, -1.0, -1.0, 0x0);
  113.     Sleep(0.3);
  114.     
  115.  
  116.     MoveToFrame(crocTarg, 1, 0.75);
  117.     MoveToFrame(gate, 1, 0.5);
  118.     
  119.     tracknum0=MaterialAnim(animmat0, fps, 1);
  120.     tracknum1=MaterialAnim(animmat1, fps, 1);
  121.     tracknum2=MaterialAnim(animmat2, fps, 1);
  122. }
  123.  
  124. return;
  125.  
  126. # ........................................................................................
  127. arrived:
  128.  
  129. if (GetSenderRef() == gate)
  130.     {
  131.     StopAnim(tracknum0);
  132.     StopAnim(tracknum1);
  133.     StopAnim(tracknum2);
  134.     
  135.     # Return control and camera to player
  136.     Sleep(0.5);
  137.     
  138.     SetCameraPosition(1, GetThingPos(crocCam));
  139.     SetCurrentCamera(1);
  140.     CopyOrientandPos(actor, player);
  141.     SetThingFlags(actor, 0x80000);
  142.     ClearThingFlags(player, 0x80000);
  143.     ClearActorFlags(player, 0x200000);
  144.     EndCutscene();
  145.     }
  146.     
  147. return;
  148.  
  149. # ........................................................................................
  150. entered:
  151. if (GetSenderRef() == leverFace)
  152. {
  153.     position=1;
  154.     
  155. }
  156. return;
  157. # ........................................................................................
  158.  
  159. exited:
  160. if (GetSenderRef() == leverFace)
  161. {
  162.     position=0;
  163. }
  164. return;
  165.  
  166. # ........................................................................................
  167.  
  168. end
  169.  
  170.